//
//  MYXInformationViewModel.m
//  meiyinxiang
//
//  Created by lizidi on 2018/1/18.
//  Copyright © 2018年 hbjApple. All rights reserved.
//

#import "MYXInformationViewModel.h"
#import "MYXotheruserinfoModel.h"



@implementation MYXInformationViewModel

-(void)loadMyInformationModelView:(NSString *)userID WithResult:(informationBlock)block{
    
    NSString * informationUserID = userID;
    [[Http sharedInstance] requestForMethod:GET Url:MYX_otheruserinfo_URL withParams:@{@"userID":informationUserID} completion:^(id data, NSError *error) {
        if (data) {
            NSString *message = data[@"message"];
            if ([data[@"status"] intValue] == 1) {
                
                NSMutableArray *list = [NSMutableArray array];
                NSError *err = nil;
                NSMutableArray *dataArray = data[@"data"][@"publish"];
//                list = [MYXotheruserinfoModelList arrayOfModelsFromDictionaries:dataArray error:&err];
//                
                
                
                MYXotheruserinfoModel *MYXotheruserinfoM = [MYXotheruserinfoModel mj_objectWithKeyValues:data[@"data"]];
                
                block(YES, message);
                
            }else{
                block(NO,message);
            }
            
        }else{
            block(NO,@"请求出错");
        }
        
        
    }];
    
    //    [[MYXHttpManager shared]otheruserinfo:userID withResult:^(BOOL success, NSString *msg, id object) {
    //        if (success) {
    //            if (object) {
    //                [SVProgressHUD dismiss];
    //
    //                //                    self.MYXotheruserinfoM= object;
    //                //                    self.informationHeadView.otheruserinfoModel = self.MYXotheruserinfoM;
    //                //                    [self.myTableView reloadData];
    //                //                    [self.headerView sd_setImageWithURL:[NSURL URLWithString:self.MYXotheruserinfoM.image]placeholderImage:[UIImage imageNamed:@"AppIcon"]];
    //                block(YES);
    //            }
    //
    //        }else{
    //
    //            block(NO);
    //        }
    //
    //
    //
    //
    //            } errorResult:^(NSError *enginerError) {
    //                [SVProgressHUD dismiss];
    //                block(NO);
    //                // [JXTHUDHelper showHUDText:enginerError type:@"error" inView:nil];
    //            }];
    
    
}



@end
